Rotary switches of the general type similar to this invention are known to use rotatable cams to actuate spring switches within a switch housing that is insertable within a panel opening. Such rotatable cams are usually axially offset to operate the switch mechanism. Moreover, such switches use detents to hold the switch knob and the cams in a set position. However, such switch units are not usually programmable, whereby the same setting of the knob can effect various switching functions, depending upon the relative orientation of the detent mechanism and the camming member. In addition, prior art switches require great structural length to accommodate the various operative elements.